﻿<%@ Page Language="C#" MasterPageFile="~/Administrator/Admin.master" AutoEventWireup="true"
    Inherits="Administrator_AdminNews" Title="Quản trị tin tức" CodeBehind="AdminNews.aspx.cs" %>

<%@ Register Src="~/Administrator/Controls/PaggingControl.ascx" TagName="PaggingControl"
    TagPrefix="EHT" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h1>
        <asp:Label ID="lbAdminNew" runat="server" Text="DANH SÁCH TIN TỨC"></asp:Label>
    </h1>
    <p class="submitButton">
        <asp:Button ID="btnAdd" runat="server" Text="Thêm mới tin tức" OnClick="btnAdd_Click"
            CssClass="btn_action" />
    </p>
    <table cellspacing="0" cellpadding="0" class="data-table">
        <tr>
            <td style="width: 25%;" valign="top">
                <asp:TreeView ID="trvDanhMucTinTuc" runat="server" ShowLines="true" OnSelectedNodeChanged="trvDanhMucTinTuc_SelectedNodeChanged">
                </asp:TreeView>
            </td>
            <td style="width: 75%" valign="top">
                <asp:Repeater ID="rpTinTuc" runat="server" OnItemCommand="rpTinTuc_ItemCommand">
                    <HeaderTemplate>
                        <table cellspacing="0" cellpadding="0" class="data-table">
                            <thead>
                                <tr>
                                    <th align="center">
                                        STT
                                    </th>
                                    <th align="center" class="actions edit">
                                        Sửa
                                    </th>
                                    <th align="center" class="actions delete">
                                        Xóa
                                    </th>
                                    <th align="center">
                                        Tiêu Đề (VN)
                                    </th>
                                    <th align="center" class="OtherLanguage">
                                        Tiêu Đề (Other)
                                    </th>
                                    <th align="center">
                                        Ngày tạo
                                    </th>
                                    <th align="center">
                                        Người tạo
                                    </th>
                                    <th align="center">
                                        Hình Ảnh
                                    </th>
                                    <th align="center" style="width: 60px">
                                        Thứ tự
                                        <asp:ImageButton ID="ibtnSaveAll" ImageUrl="Templates/Images/save_all.jpg" Height="20"
                                            Width="20" OnClientClick="return confirm('Bạn muốn lưu ?');" runat="server" BorderStyle="None"
                                            CommandName="save_all" />
                                    </th>
                                    <th align="center">
                                        Trạng thái
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td style="width: 15px">
                                <%#Eval("IndexId")%>
                            </td>
                            <td class="actions edit">
                                <a href='AdminNewsIU.aspx?TinTucID=<%#Eval("TinTucID")%>&DanhMucTinTucID=<%#Eval("DanhMucTinTucID")%>'>
                                    <img alt="Edit" src="Templates/Images/Edit.png"></a>
                                <asp:Literal ID="ltrTinTucID" runat="server" Visible="false" Text='<%#Eval("TinTucID")%>'></asp:Literal>
                            </td>
                            <td class="actions delete">
                                <a href='#'>
                                    <asp:ImageButton ID="btnDelete" ToolTip="Delete" CommandArgument='<%#Eval("TinTucID")%>'
                                        CommandName="delete1" runat="server" ImageUrl="Templates/Images/Delete.png" OnClientClick="return confirm('Bạn có muốn xóa danh mục tin tức này không ?');  " />
                            </td>
                            <th>
                                <%#Eval("TieuDeVN") %>
                            </th>
                            <th class="OtherLanguage">
                                <%#Eval("TieuDeOther") %>
                            </th>
                            <td>
                                <%#Eval("NgayTao")%>
                            </td>
                            <td>
                                <%#Eval("NguoiTao") %>
                            </td>
                            <td style="text-align: center">
                                <asp:Image ID="imgHinhAnhUrl" runat="server" Height="60" Width="80" ImageUrl='~ImageDatas/News/<%#Eval("HinhAnhUrl")%>' />
                            </td>
                            <td>
                                <asp:TextBox ID="txtNumberOfOrder" Width="30" runat="server" Text='<%#Eval("SapXep")%>'></asp:TextBox>
                                <asp:ImageButton Width="16" Height="16" ID="btnSaveNumberOfOrder" CommandName="change_number_of_order"
                                    CommandArgument='<%#Eval("TinTucID") %>' ImageUrl="Templates/Images/save.jpg"
                                    runat="server" />
                            </td>
                            <td align="center" style="width: 60px">
                                <asp:CheckBox ID="ckPublish" runat="server" Checked='<%#Eval("TrangThai")%>' Visible="false" />
                                <asp:ImageButton Width="16" Height="16" ID="btnPublish" CommandName="publish" CommandArgument='<%#Eval("TinTucID") %>'
                                    ImageUrl="Templates/Images/btncheck.png" runat="server" />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </tbody> </table>
                    </FooterTemplate>
                </asp:Repeater>
                <p>
                    <EHT:PaggingControl ID="PaggingControl1" runat="server" PageURL="AdminNews.aspx"
                        PageSize="20" />
                </p>
            </td>
        </tr>
    </table>
</asp:Content>
